<html>
<head>
<link rel="stylesheet" href="/static/diary.css" type="text/css">
</head>

<body>
<h1>Employee List</h1>

{% if errors %}
<ul>
{% for error in errors %}
<li>{{error}}</li>
{% endfor %}
</ul>
{% endif %}
<form action="/employee/" method="post">
{% csrf_token %}
<table border='0' cellspacing='0' cellpadding='0'>
    <tr>
        <th>&nbsp;</th>
        <th>姓名</th>
        <th>密码</th>
        <th>性别</th>
        <th>生日</th>
        <th>部门</th>
        <th>邮件</th>
    </tr>
{% for ey in ey_list %}
<tr>
    <td><input type="checkbox" name="ey_del" value={{ey.name}}></input></td>
    <td>{{ey.name}}</td>
    <td>{{ey.passwd}}</td>
    <td>{{ey.sex}}</td>
    <td>{{ey.birthday}}</td>
    <td>{{ey.department}}</td>
    <td>{{ey.email}}</td>
</tr>
{% endfor %}
</table>
<input type="submit" name="op" value="del"></input>
<br/><br/>

<table border="0" cellspacing="0" cellpading="0">
<tr><th>姓名</th><td><input type="text" name="ey_name"></td></tr>
<tr><th>密码</th><td><input type="password" name="ey_passwd"></td></tr>
<tr><th>性别</th><td><input type="text" name="ey_sex"></td></tr>
<tr><th>生日</th><td><input type="text" name="ey_birthday"></td></tr>
<tr><th>部门</th>
    <td><select name="ey_department">
    {% for dp in dp_list %}
    <option value="{{dp.name}}">{{dp.name}}</option>
    {% endfor %}
    </select></td>
</tr>
<tr><th>电子邮箱</th><td><input type="text" name="ey_email"></td></tr>
</table>
<input type="submit" name="op" value="add"></input>
</form>

</body>
</html>
